import Vue from 'vue'
import Router from 'vue-router'
//import Home from './views/Home.vue'
import signin from './components/signin.vue'
//import home from '@/components/home'
//懒加载
const home = () => import(/* webpackChunkName: "home" */ '@/components/home')
const quanxianguanli = () => import(/* webpackChunkName: "quanxianguanli" */ '@/components/quanxianguanli/quanxianguanli')
const jueseguanli = () => import(/* webpackChunkName: "jueseguanli" */ '@/components/jueseguanli/jueseguanli')
const yonghuguanli = () => import(/* webpackChunkName: "yonghuguanli" */ '@/components/yonghuguanli/yonghuguanli')
const caipiaolist=()=>import(/* webpackChunkName: "caipiaolist" */ '@/components/caipiaoguanli/caipiaolist')
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/signin',
      name: 'signin',
      component: signin
    },
    {
    	path:'/home',
    	component:home,
    	name:'name',
    	children:[
    			{
    				path:'quanxianguanli',
    				name:'权限管理',
    				component:quanxianguanli
    			},
    			{
    				path:'jueseguanli',
    				name:'角色管理',
    				component:jueseguanli
    			},
    			{
    				path:'yonghuguanli',
    				name:'用户管理',
    				component:yonghuguanli
    			},
    			{
    				path:'caipiaolist',
    				name:'彩票列表',
    				component:caipiaolist
    			}
    	]
    },
    {
    	path:'/',
    	redirect:'/home'
    }
//  {
//    path: '/about',
//    name: 'about',
//    // route level code-splitting
//    // this generates a separate chunk (about.[hash].js) for this route
//    // which is lazy-loaded when the route is visited.
//    component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
//  }
  ]
})
